import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 牛客网.简单题.判断质数
 */

class Main {
    public static void main(String[] args) {
        Main main = new Main();
        Scanner scan = new Scanner(System.in);
        int number = scan.nextInt();
        System.out.println(main.isPrimeNumber(number));
    }

    public Boolean isPrimeNumber(int number) {

        //write your code here......
        boolean ret = true;
        for(int i = 2; i <= Math.sqrt(number); i++) {
            if(number % i == 0) {
                ret = false;
                return ret;
            }
        }
        return ret;
    }
}

public class Test {
}
